//
//  TestRouterViewController.swift
//  ADKit_Example
//
//  Created by Adoma on 2023/12/26.
//  Copyright © 2023 CocoaPods. All rights reserved.
//

import ADKit

class TestRouterViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .init(hex: "0x2b2b2b")
        
        let textfield = UITextField()
        textfield.backgroundColor = .random
        view.addSubview(textfield)
        textfield.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.width.equalTo(100)
            make.height.equalTo(50)
        }
        
        textfield.addTarget(self, action: #selector(beginInputAction), for: .editingDidBegin)
    }
    
    @objc func beginInputAction() {
        DispatchQueue.main.after(time: 3) {
            ADToast.show(msg: "打断输入框第一响应")
        }
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        dismiss(animated: true)
    }
}
